package cc.czlee.cloud.demo.service;

import cc.czlee.cloud.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/*
 * Create by Colbert on 2019-05-01
 *
 * Copyright (C) 2019 chuanzhigo@gmail.com.
 */

/**
 * FeignClient 注解将自动实现该调用的实现
 * name: 要调用的服务的 spring.application.name
 * fallback: 当被调用服务不可用时的默认实现
 */
@FeignClient(name = "User", fallback = UserFeignClientFallback.class)
public interface UserFeignClient {

    @PostMapping("/user/login/")
    boolean login(@RequestBody User user);

    @GetMapping("/user/login/")
    String login(@RequestParam("count") int count);
}
